<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>XenC: include/phrasetable.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">XenC
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Open-source tool for data selection in NLP</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">phrasetable.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="phrasetable_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">/*  This file is part of the cross-entropy tool for data selection (XenC)</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *  aimed at speech recognition and statistical machine translation.</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *  Copyright 2013-2016, Anthony Rousseau, LIUM, University of Le Mans, France</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> *  Development of the XenC tool has been partially funded by the</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> *  European Commission under the MateCat project.</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> *  The XenC tool is free software; you can redistribute it and/or modify it</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> *  under the terms of the GNU Lesser General Public License version 3 as</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> *  published by the Free Software Foundation</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> *  This library is distributed in the hope that it will be useful, but WITHOUT</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> *  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> *  for more details.</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> *  You should have received a copy of the GNU Lesser General Public License</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> *  along with this library; if not, write to the Free Software Foundation,</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment"> *  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#ifndef PHRASETABLE_H_</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#define PHRASETABLE_H_</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="common_8h.html">utils/common.h</a>&quot;</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="xenoption_8h.html">xenoption.h</a>&quot;</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="sourcephrase_8h.html">sourcephrase.h</a>&quot;</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keyword">class </span><a class="code" href="class_xen_i_o.html">XenIO</a>;    <span class="comment">// Forward declaration</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="class_phrase_table.html">   48</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_phrase_table.html">PhraseTable</a> {</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <a class="code" href="class_phrase_table.html#aeea9cf41c0fe564011cf9e69d0fa4174">PhraseTable</a>();</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    </div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_phrase_table.html#ad7b885bf055e632ef0a3ea08b3a56215">initialize</a>(boost::shared_ptr&lt;XenFile&gt; ptrData);</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    </div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <a class="code" href="class_phrase_table.html#a004ca89ec6dbda91aa1eb8339e6f1f2a">~PhraseTable</a>();</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    boost::shared_ptr&lt;XenFile&gt; <a class="code" href="class_phrase_table.html#a9e82a1296848e36cbf376754a4594332">getXenFile</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    </div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    std::string <a class="code" href="class_phrase_table.html#afed99089344b3b9c294b68e1357e9e13">getSource</a>(<span class="keywordtype">int</span> n);</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    </div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    std::string <a class="code" href="class_phrase_table.html#af502a1c69356c10e50bc9768bee72991">getTarget</a>(<span class="keywordtype">int</span> n);</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    </div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    std::string <a class="code" href="class_phrase_table.html#a1a6951601e23324b860140ccf88059e7">getScores</a>(<span class="keywordtype">int</span> n);</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    </div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    std::string <a class="code" href="class_phrase_table.html#a52792d5aceb6355f8e52672e4d4e2570">getAlignment</a>(<span class="keywordtype">int</span> n);</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    </div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    std::string <a class="code" href="class_phrase_table.html#a5cdec93022f04bc65e3e315efcb85186">getCounts</a>(<span class="keywordtype">int</span> ph);</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    </div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    std::vector&lt;SourcePhrase&gt; <a class="code" href="class_phrase_table.html#a26124a8baed2aacc32ac855a2ed8a759">getSrcPhrases</a>();</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    </div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_phrase_table.html#acecda1214c68dfe359656aac2401462a">setSrcPhrases</a>(std::vector&lt;SourcePhrase&gt; vSP);</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    </div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_phrase_table.html#a131e70dc06b4d9bdda8f566f43714600">getSize</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    </div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    boost::shared_ptr&lt;XenFile&gt; ptrFile;     </div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    boost::shared_ptr&lt;std::vector&lt;std::string&gt; &gt; ptrPhPairs;    </div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    std::string dlm;    </div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    <a class="code" href="class_xen_common_1_1_splitter.html">XenCommon::Splitter</a> lineSpl;    </div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> size;  </div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    boost::shared_ptr&lt;std::vector&lt;SourcePhrase&gt; &gt; ptrSrcPhrases;    </div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    </div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    <span class="keywordtype">void</span> loadTable();</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    </div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    <span class="keywordtype">void</span> mergePhrasesBySource();</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;};</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="class_phrase_table_html_a5cdec93022f04bc65e3e315efcb85186"><div class="ttname"><a href="class_phrase_table.html#a5cdec93022f04bc65e3e315efcb85186">PhraseTable::getCounts</a></div><div class="ttdeci">std::string getCounts(int ph)</div><div class="ttdoc">Accessor to the nth counts for the source/target phrase pair. </div><div class="ttdef"><b>Definition:</b> phrasetable.cpp:99</div></div>
<div class="ttc" id="class_phrase_table_html_a26124a8baed2aacc32ac855a2ed8a759"><div class="ttname"><a href="class_phrase_table.html#a26124a8baed2aacc32ac855a2ed8a759">PhraseTable::getSrcPhrases</a></div><div class="ttdeci">std::vector&lt; SourcePhrase &gt; getSrcPhrases()</div><div class="ttdoc">Accessor to the vector of merged source phrases. </div><div class="ttdef"><b>Definition:</b> phrasetable.cpp:104</div></div>
<div class="ttc" id="class_phrase_table_html_a52792d5aceb6355f8e52672e4d4e2570"><div class="ttname"><a href="class_phrase_table.html#a52792d5aceb6355f8e52672e4d4e2570">PhraseTable::getAlignment</a></div><div class="ttdeci">std::string getAlignment(int n)</div><div class="ttdoc">Accessor to the nth alignments for the source/target phrase pair. </div><div class="ttdef"><b>Definition:</b> phrasetable.cpp:94</div></div>
<div class="ttc" id="class_phrase_table_html_acecda1214c68dfe359656aac2401462a"><div class="ttname"><a href="class_phrase_table.html#acecda1214c68dfe359656aac2401462a">PhraseTable::setSrcPhrases</a></div><div class="ttdeci">void setSrcPhrases(std::vector&lt; SourcePhrase &gt; vSP)</div><div class="ttdoc">Mutator to the vector of merged source phrases. </div><div class="ttdef"><b>Definition:</b> phrasetable.cpp:109</div></div>
<div class="ttc" id="class_phrase_table_html_aeea9cf41c0fe564011cf9e69d0fa4174"><div class="ttname"><a href="class_phrase_table.html#aeea9cf41c0fe564011cf9e69d0fa4174">PhraseTable::PhraseTable</a></div><div class="ttdeci">PhraseTable()</div><div class="ttdoc">Default constructor. </div><div class="ttdef"><b>Definition:</b> phrasetable.cpp:34</div></div>
<div class="ttc" id="class_xen_common_1_1_splitter_html"><div class="ttname"><a href="class_xen_common_1_1_splitter.html">XenCommon::Splitter</a></div><div class="ttdoc">Class defining a splitter. </div><div class="ttdef"><b>Definition:</b> common.h:276</div></div>
<div class="ttc" id="class_phrase_table_html"><div class="ttname"><a href="class_phrase_table.html">PhraseTable</a></div><div class="ttdoc">Class handling phrase-table related functionalities. </div><div class="ttdef"><b>Definition:</b> phrasetable.h:48</div></div>
<div class="ttc" id="class_phrase_table_html_a1a6951601e23324b860140ccf88059e7"><div class="ttname"><a href="class_phrase_table.html#a1a6951601e23324b860140ccf88059e7">PhraseTable::getScores</a></div><div class="ttdeci">std::string getScores(int n)</div><div class="ttdoc">Accessor to the nth scores for the source/target phrase pair. </div><div class="ttdef"><b>Definition:</b> phrasetable.cpp:89</div></div>
<div class="ttc" id="class_phrase_table_html_ad7b885bf055e632ef0a3ea08b3a56215"><div class="ttname"><a href="class_phrase_table.html#ad7b885bf055e632ef0a3ea08b3a56215">PhraseTable::initialize</a></div><div class="ttdeci">void initialize(boost::shared_ptr&lt; XenFile &gt; ptrData)</div><div class="ttdoc">Initialization function from an already instanciated XenFile. </div><div class="ttdef"><b>Definition:</b> phrasetable.cpp:38</div></div>
<div class="ttc" id="class_xen_i_o_html"><div class="ttname"><a href="class_xen_i_o.html">XenIO</a></div><div class="ttdoc">Class handling all input/output operations of XenC. </div><div class="ttdef"><b>Definition:</b> xenio.h:70</div></div>
<div class="ttc" id="class_phrase_table_html_afed99089344b3b9c294b68e1357e9e13"><div class="ttname"><a href="class_phrase_table.html#afed99089344b3b9c294b68e1357e9e13">PhraseTable::getSource</a></div><div class="ttdeci">std::string getSource(int n)</div><div class="ttdoc">Accessor to the nth source phrase. </div><div class="ttdef"><b>Definition:</b> phrasetable.cpp:79</div></div>
<div class="ttc" id="class_phrase_table_html_a131e70dc06b4d9bdda8f566f43714600"><div class="ttname"><a href="class_phrase_table.html#a131e70dc06b4d9bdda8f566f43714600">PhraseTable::getSize</a></div><div class="ttdeci">unsigned int getSize() const </div><div class="ttdoc">Accessor to the size of the PhraseTable. </div><div class="ttdef"><b>Definition:</b> phrasetable.cpp:113</div></div>
<div class="ttc" id="common_8h_html"><div class="ttname"><a href="common_8h.html">common.h</a></div><div class="ttdoc">File containing all common classes/structures/functions of many classes of XenC. </div></div>
<div class="ttc" id="sourcephrase_8h_html"><div class="ttname"><a href="sourcephrase_8h.html">sourcephrase.h</a></div><div class="ttdoc">Class holding a merged source phrase and all associated data. </div></div>
<div class="ttc" id="class_phrase_table_html_af502a1c69356c10e50bc9768bee72991"><div class="ttname"><a href="class_phrase_table.html#af502a1c69356c10e50bc9768bee72991">PhraseTable::getTarget</a></div><div class="ttdeci">std::string getTarget(int n)</div><div class="ttdoc">Accessor to the nth target phrase. </div><div class="ttdef"><b>Definition:</b> phrasetable.cpp:84</div></div>
<div class="ttc" id="xenoption_8h_html"><div class="ttname"><a href="xenoption_8h.html">xenoption.h</a></div><div class="ttdoc">Singleton class handling XenC options accessors/mutators. </div></div>
<div class="ttc" id="class_phrase_table_html_a004ca89ec6dbda91aa1eb8339e6f1f2a"><div class="ttname"><a href="class_phrase_table.html#a004ca89ec6dbda91aa1eb8339e6f1f2a">PhraseTable::~PhraseTable</a></div><div class="ttdeci">~PhraseTable()</div><div class="ttdoc">Default destructor. </div><div class="ttdef"><b>Definition:</b> phrasetable.cpp:71</div></div>
<div class="ttc" id="class_phrase_table_html_a9e82a1296848e36cbf376754a4594332"><div class="ttname"><a href="class_phrase_table.html#a9e82a1296848e36cbf376754a4594332">PhraseTable::getXenFile</a></div><div class="ttdeci">boost::shared_ptr&lt; XenFile &gt; getXenFile() const </div><div class="ttdoc">Accessor to the XenFile associated to the PhraseTable. </div><div class="ttdef"><b>Definition:</b> phrasetable.cpp:75</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Mar 18 2016 17:22:37 for XenC by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
